- if @already_been_taken
  :plain
    target_field = $("tr#repo_#{@repo_id} .import-target")
    origin_target = target_field.text()
    project_name = "#{@project_name}"
    origin_namespace = "#{@target_namespace}"
    target_field.empty()
    target_field.append("<p class='alert alert-danger'>此命名空间已被使用！请选择其他的</p>")
    target_field.append("<input type='text' name='target_namespace' />")
    target_field.append("/" + project_name)
    target_field.data("project_name", project_name)
    target_field.find('input').prop("value", origin_namespace)
- elsif @access_denied
  :plain
    job = $("tr#repo_#{@repo_id}")
    job.find(".import-actions").html("<p class='alert alert-danger'>没有访问权限！请确认是否增加了此版本仓库的部署密钥。</p>")
- elsif @project.persisted?
  :plain
    job = $("tr#repo_#{@repo_id}")
    job.attr("id", "project_#{@project.id}")
    target_field = job.find(".import-target")
    target_field.empty()
    target_field.append('#{link_to @project.path_with_namespace, namespace_project_path(@project.namespace, @project)}')
    $("table.import-jobs tbody").prepend(job)
    job.addClass("active").find(".import-actions").html("<i class='fa fa-spinner fa-spin'></i> 已开始")
- else
  :plain
    job = $("tr#repo_#{@repo_id}")
    job.find(".import-actions").html("<i class='fa fa-exclamation-circle'></i> 保存项目错误： #{escape_javascript(@project.errors.full_messages.join(','))}")
